<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;
Route::get('index','index/index');
Route::get('login','Login/login');



//-------------------API接口---------------------
// ++++++++++++ 首页 Begin ++++++++++++ //
// 首页数据
Route::rule('wx/getHomeFrame','api/Home/getHomeFrame');
// 店铺
Route::post('wx/getBusinessAreaType','api/Type/getBusinessAreaType'); // 获取分类
Route::post('wx/getStoreByType','api/Store/getStoreByType'); // 列表
Route::post('wx/getStoreDetails','api/Store/getStoreDetails'); // 商家详情
// 公告
Route::rule('wx/getAnnouncement','api/Announcement/getList'); // 列表
Route::rule('wx/getAnnouncementDetail','api/Announcement/getDetail'); // 详情


// ++++++++++++ 我的 Begin ++++++++++++ //
// 个人资料
Route::rule('wx/userinfo/userInfo','api/User/userInfo'); // 详情
Route::rule('wx/userinfo/saveUser','api/User/saveUser'); // 保存
// 我领的券
Route::rule('wx/myTicket','api/User/myTickets');
// 我的关注
Route::rule('wx/myFocus','api/User/myFocus');
// ++++++ 我的店铺 ++++++ //
Route::rule('wx/myStore','api/Store/myStore'); // 首页
// 创建店铺
Route::rule('wx/createMyStore','api/Store/createMyStore');
// 进店
Route::rule('wx/myUserinstore','api/User/myUserinstore');
// 被关注
Route::rule('wx/myBeFocus','api/User/myBeFocus');
// 优惠
Route::post('wx/getStoreTickets','api/Store/getStoreTickets'); // 获取店铺优惠券
Route::post('wx/getTicketDetails','api/Ticket/getTicketDetails'); // 获取优惠券详情
Route::post('wx/createTicket','api/Ticket/createTicket'); // 创建优惠
Route::post('wx/deleteTicket','api/Ticket/deleteTicket'); // 删除优惠
// 商品展示
Route::rule('wx/getStoregoods','api/Storegoods/getStoregoods'); // 列表
Route::rule('wx/saveStoregoods','api/Storegoods/saveStoregoods'); // 保存
Route::rule('wx/delStoregoods','api/Storegoods/delStoregoods'); // 删除
// 店铺介绍
Route::post('wx/getStoreIntroduce','api/Store/getStoreIntroduce');
Route::post('wx/saveStoreIntroduce','api/Store/saveStoreIntroduce'); // 保存
// 核销
Route::post('wx/insertCancelRecord','api/Ticket/insertCancelRecord'); //扫码核销优惠券
Route::post('wx/getCancelRecord','api/Ticket/getCancelRecord'); // 列表
Route::post('wx/deleteCancelRecord','api/Ticket/deleteCancelRecord'); // 删除
// 客户管理
Route::rule('wx/myStoreuser','api/Storeuser/getList'); // 列表
Route::rule('wx/storeuserDetail','api/Storeuser/getDetail'); // 详情
// 店铺标签
Route::rule('wx/getAllLabel','api/Label/getAllLabel'); // 列表
Route::rule('wx/saveLabel','api/Label/saveLabel'); // 保存
Route::rule('wx/deleteLabel','api/Label/deleteLabel'); // 删除
// 店铺消息
Route::rule('wx/getStoremessage','api/Storemessage/getList'); // 列表
Route::rule('wx/getStoremessageDetail','api/Storemessage/getDetail'); // 详情
// 投放广告
Route::rule('wx/getAdvertiseList','api/Ad/getAdvertiseList'); // 广告列表
Route::rule('wx/getAdvertiseLocalInfo','api/Ad/getAdvertiseLocalInfo'); // 广告位
Route::rule('wx/createAdvertise','api/Ad/createAdvertise'); // 投放广告
Route::rule('wx/adPayment','api/Ad/adPayment'); // 广告订单支付
Route::rule('api/adpay/notify','api/Ad/receiveNotify'); // 广告支付回调
// 交易
Route::post('wx/storeTradeIn','api/Store/storeTradeIn'); // 收入记录
Route::post('wx/storeTradeOut','api/Store/storeTradeOut'); // 支出记录
// 结算
Route::post('wx/storeSettlements','api/Store/storeSettlements');
// ++++++++++++ 我的 End ++++++++++++ //


// 购买券、扫码当面付
Route::post('wx/requestPayment','api/Common/requestPayment');

Route::post('wx/getBusinessArea','api/Businessarea/getBusinessArea'); //获取商圈信息

Route::post('wx/receiveTicket','api/Ticket/receiveTicket'); //免费领取优惠券
Route::rule('api/pay/notify','api/Ticket/receiveNotify');
Route::post('wx/getTicketForPay','api/Ticket/getTicketForPay'); //支付时选择可用的优惠券



// ++++++++++++ 通用 ++++++++++++ //
// 获取类型
Route::post('wx/getTypeName','api/Common/getTypeName');
//获取店铺二维码
Route::post('wx/getStoreCode','api/Common/getStoreCode');
// 搜索店铺
Route::post('wx/searchStore','api/Common/searchStore');
// 店铺关注/取消关注
Route::post('wx/focusStore','api/Common/focusStore');
//获取店铺状态
Route::post('wx/getStoreStatus','api/Common/getStoreStatus');
// 进店数量统计
Route::post('wx/addInStore','api/Common/addInStore');
//判断我是否有店铺
Route::post('wx/isMyStore','api/Common/MyisthereanyStore');
// 上传图片
Route::post('wx/uploadimg','Upload/upload');
// 删除图片
Route::post('wx/deleteimg','Upload/delete');


// ++++++++++++++++++++ 获取openID ++++++++++++++++++++ //
Route::post('wx/getUser','api/Token/getToken'); //获取用户信息
Route::rule('wx/decodePhone','api/UserInfo/decodePhone');  //解析手机号


Route::post('wx/getPhoneCode','api/Sms/getPhoneCode');